From 2701e7ad006732ce9703d39708c1fa537db15d34 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Mon, 26 Jan 2009 08:59:14 +0000 Subject: [PATCH] babl/babl.h renamed babl_format_get_num_of_components() to 2009-01-26 Sven Neumann * babl/babl.h * babl/babl-format.c: renamed babl_format_get_num_of_components() to babl_format_get_n_components(). (babl_format_has_alpha): changed accordingly. svn path=/trunk/; revision=391 --- ChangeLog | 7 +++++++ babl/babl-format.c | 11 +++++------ babl/babl.h | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 126762b..175f9a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-01-26 Sven Neumann + + * babl/babl.h + * babl/babl-format.c: renamed babl_format_get_num_of_components() + to babl_format_get_n_components(). + (babl_format_has_alpha): changed accordingly. + 2009-01-24 Martin Nordholts Do a complete overhaul of the babl API. diff --git a/babl/babl-format.c b/babl/babl-format.c index 45dfa05..a9f6878 100644 --- a/babl/babl-format.c +++ b/babl/babl-format.c @@ -331,19 +331,18 @@ babl_formats_count (void) int babl_format_has_alpha (const Babl *format) { + int n = babl_format_get_n_components (format); int i; - int has_alpha = 0; - for (i = 0; i < babl_format_get_num_of_components (format); i++) + for (i = 0; i < n; i++) { if (format->format.component[i]->alpha) { - has_alpha = 1; - break; + return 1; } } - return has_alpha; + return 0; } int @@ -358,7 +357,7 @@ babl_format_get_bytes_per_pixel (const Babl *format) } int -babl_format_get_num_of_components (const Babl *format) +babl_format_get_n_components (const Babl *format) { if (format->class_type == BABL_FORMAT) { diff --git a/babl/babl.h b/babl/babl.h index bd53839..e8d6fca 100644 --- a/babl/babl.h +++ b/babl/babl.h @@ -103,7 +103,7 @@ int babl_format_get_bytes_per_pixel (const Babl *format); /** * Returns the number of components for the given @format. */ -int babl_format_get_num_of_components (const Babl *format); +int babl_format_get_n_components (const Babl *format); /** * Returns the type in the given @format for the given -- 2.30.2